﻿function ieFix(topLevel, node){
	var ua = navigator.userAgent,
		isMSIE = (navigator.appName == "Microsoft Internet Explorer"),
		isMSIE5_5 = isMSIE && (ua.indexOf("MSIE 5.5") != -1),
		isMSIE6 = isMSIE && (ua.indexOf("MSIE 6.0") != -1),
		parent = document.getElementById(node) || document;
		
	if(isMSIE5_5 || isMSIE6){
		document.getElementById(topLevel).innerHTML
			= document.getElementById(topLevel).innerHTML
				.replace(/<ul/gi,"<table><tr><td><ul")
				.replace(/<\/ul>/gi,"</ul></td></tr></table></a>");
	
		var liSet = parent.getElementsByTagName("li");
		for(var i=0; i<liSet.length; i++){
			if(liSet.item(i).className == "sub"){
				liSet.item(i).innerHTML = liSet.item(i).innerHTML.replace(/<\/a>/i, "");
			}
		}
	}
}